/*---------------------------------*\
|  namespace: Csdn.Common
|  Author:    meizz
|  Version:   2007-01-16
\*---------------------------------*/
function countContentLength(str, length, target)
{
    if("string"==typeof target) target=document.getElementById(target);
    if(target) target.innerHTML = (length - str.replace(/[^\x00-\xff]/g, "mm").length);
}

//for csdn tips UserControl
function hsTipContent(div)
{
  var ds=div.parentNode.parentNode.parentNode.getElementsByTagName('DIV');
  for(var i=0; i<ds.length; i++)
  {
    if(ds[i].className=="csdnTipContent")
    {
      var b=ds[i].style.display=='none';
      b ? MzEffect.expand(ds[i]) : MzEffect.collapse(ds[i])  
      div.className=b?'':'hide'
    }
  }
}